package org.fuxia.im.core.bakup;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class IteratorDemo
{

	public static void main(String[] args)
	{
		List<String> list = new ArrayList<String>();
		list.add("first");
		list.add("second");
		list.add("three");
		list.add("four");
		list.add("five");
		list.add("six");

		Iterator<String> iter = list.iterator();
		while (iter.hasNext())
		{
			String curr = iter.next();
			System.out.println("<current value>: " + curr);
			iter.remove();
			System.out.print("<Contains Value>: ");
			for (int i = 0; i < list.size(); i++)
			{
				System.out.print(list.get(i) + " ");
			}
			System.out.println();
		}
	}

}
